package cn.wolfcode.domain;


import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.HashMap;

@Setter
@Getter
@ToString
public class Department {
    private Long id;
    private String name;
    private String sn;

   public String getJson(){
       HashMap<String, Object> map = new HashMap<>();
       map.put("id",id);
       map.put("name",name);
       map.put("sn",sn);
       return JSON.toJSONString(map);      //将对象转化为Json格式的字符串,给到视图显示数据
   }

}